package org.origin.centre.config;

import org.origin.centre.config.properties.ServerProperty;
import org.origin.centre.utils.SpringUtil;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Lazy;
import org.springframework.core.Ordered;
import org.springframework.core.annotation.Order;

/**
 * 自动加载配置
 *
 * @author ferret
 * @version 2024-05-08
 */
@Configuration(proxyBeanMethods = false)
@SuppressWarnings("SpringFacetCodeInspection")
public class IAutoLoadConfig {

    @Lazy(false)
    @Bean("springContextHolder")
    @Order(Ordered.HIGHEST_PRECEDENCE)
    public SpringUtil springContextHolder() {
        return new SpringUtil();
    }

    @Bean("serverProperty")
    @Order(Ordered.HIGHEST_PRECEDENCE)
    public ServerProperty serverProperty() {
        return new ServerProperty();
    }
}
